package com.cez.itstudio01.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 
 * @TableName book
 */
@TableName(value ="book")
public class Book implements Serializable {
    /**
     * 
     */
    @TableId("ID")
    private String id;

    /**
     * 
     */
    private String name;

    /**
     * 
     */
    private Integer borrowedNum;

    /**
     * 
     */
    private Integer totalNum;

    /**
     * 
     */
    private String publisher;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Book(String id, String name, Integer borrowedNum, Integer totalNum, String publisher) {
        this.id = id;
        this.name = name;
        this.borrowedNum = borrowedNum;
        this.totalNum = totalNum;
        this.publisher = publisher;
    }

    /**
     * 
     */
    public String getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 
     */
    public String getName() {
        return name;
    }

    /**
     * 
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 
     */
    public Integer getBorrowedNum() {
        return borrowedNum;
    }

    /**
     * 
     */
    public void setBorrowedNum(Integer borrowedNum) {
        this.borrowedNum = borrowedNum;
    }

    /**
     * 
     */
    public Integer getTotalNum() {
        return totalNum;
    }

    /**
     * 
     */
    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    /**
     * 
     */
    public String getPublisher() {
        return publisher;
    }

    /**
     * 
     */
    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Book other = (Book) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getBorrowedNum() == null ? other.getBorrowedNum() == null : this.getBorrowedNum().equals(other.getBorrowedNum()))
            && (this.getTotalNum() == null ? other.getTotalNum() == null : this.getTotalNum().equals(other.getTotalNum()))
            && (this.getPublisher() == null ? other.getPublisher() == null : this.getPublisher().equals(other.getPublisher()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getBorrowedNum() == null) ? 0 : getBorrowedNum().hashCode());
        result = prime * result + ((getTotalNum() == null) ? 0 : getTotalNum().hashCode());
        result = prime * result + ((getPublisher() == null) ? 0 : getPublisher().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", borrowedNum=").append(borrowedNum);
        sb.append(", totalNum=").append(totalNum);
        sb.append(", publisher=").append(publisher);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}